//
//  YSSearchNoResultView.m
//  Yueshi
//
//  Created by Northwan on 15/10/21.
//  Copyright © 2015年 悦食中国. All rights reserved.
//

#import "YSSearchNoResultView.h"

@implementation YSSearchNoResultView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        UILabel *label = [[UILabel alloc]init];
        [label setFont:[UIFont systemFontOfSize:15]];
        [label setTextAlignment:NSTextAlignmentCenter];
        [label setNumberOfLines:0];
        [label setTextColor:publicTextColor];
        NSString *string = @"抱歉，没有搜到相关商品\r\n请改变关键字重新尝试搜索";
        [label setText:string];
        CGSize labelSize = [string sizeWithFont:label.font constrainedToSize:CGSizeMake(MAXFLOAT, MAXFLOAT)];
        [label setSize:labelSize];
        
        [label setX:0];
        [label setY:self.centerY];
        [self addSubview:label];
        [self setSize:CGSizeMake(label.width, CGRectGetMaxY(label.frame))];
    }
    return self;
}


@end
